From: Florian Müllner Date: Thu, 27 Nov 2025 22:41:35 +0000 (+0100) Subject: layout: Clarify startup animation code X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~44^2~57 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=455edfdcac1a60a2c117c451e5c76b55b7f06a6f;p=gnome-shell.git layout: Clarify startup animation code Once the LayoutManager is initialized, we do the startup animation that consists of 4 steps: 1. load the system background 2. prepare the animation 3. run the animation 4. complete initialization post-animation This isn't immediately obvious right now, as the individual steps are chained in various ways. It also doesn't help that it's `_loadBackground()` that starts the chain, as that hardly implies "startup animation". Clarify that code by adding an async `_doStartupAnimation()` method that handles all steps in order. Part-of: --- diff --git a/js/ui/layout.js b/js/ui/layout.js index 5a09ea797..06afaa2aa 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -355,7 +355,7 @@ export const LayoutManager = GObject.registerClass({ init() { Main.sessionMode.connect('updated', this._sessionUpdated.bind(this)); - this._loadBackground().catch(logError); + this._doStartupAnimation().catch(logError); } showOverview() { @@ -664,6 +664,22 @@ export const LayoutManager = GObject.registerClass({ return this._keyboardIndex; } + async _doStartupAnimation() { + await this._loadBackground(); + + this._systemBackground.show(); + global.stage.show(); + + try { + await this._prepareStartupAnimation(); + await this._startupAnimation(); + } catch (e) { + logError(e); + } finally { + this._startupAnimationComplete(); + } + } + async _loadBackground() { await this._ensurePrimaryMonitor(); @@ -685,10 +701,6 @@ export const LayoutManager = GObject.registerClass({ }); await promise; - - this._systemBackground.show(); - global.stage.show(); - this._prepareStartupAnimation().catch(logError); } // Startup Animations @@ -753,12 +765,6 @@ export const LayoutManager = GObject.registerClass({ setTimeout(() => this.emit('startup-prepared'), 200); else this.emit('startup-prepared'); - - try { - await this._startupAnimation(); - } finally { - this._startupAnimationComplete(); - } } async _startupAnimation() {